firas
(Firas Abussaud)
January 4, 2023, 11:17am
1
Hello all,
I have a project where i query DB and get the results in Excel and then i need to copy that table to a word document. i manage to do all steps and it works perfectly except that the headers are not being pasted although I did not tick “Exclude Source header”
what might be the issue here?
Hello,
Please check “Exclude source headers ”, run again and try to find if it is a difference in the output.
Tell me the result, pls.
firas
(Firas Abussaud)
January 4, 2023, 11:46am
3
Thank you for your kind reply.
I just did; exactly same results…no headers
firas
(Firas Abussaud)
January 4, 2023, 11:48am
4
I tried to use read range instead but when attempted to past as picture, it complained with the below
Hello @firas , you have a formatted table in excel right? With your current source you only get the values from the formatted table.
You could try to copy Range A:Z or just the whole sheet to get headers as well.
Kind Regards
firas
(Firas Abussaud)
January 4, 2023, 11:53am
6
Thank you Lukas
yes, i have a formatted table and i need it like that as the data is different each day and i need to capture it dynamically; i cannot copy the full range as it will bring the empty cells
Hello @firas , I don´t know if there is an easy way to get the headers also.
You could do it like this though, if you have at least the same columns.
Else you would have to get the columns first and maybe store them in a variable.
Hope that helps.
Kind Regards
firas
(Firas Abussaud)
January 4, 2023, 12:05pm
8
The headers are static; the only thing that will change is the rows values!
i will try your suggestion now but how can i reach to that in StuidoX
I don´t have StudioX, so I don´t now the limitations really…
You could try to enter “Excel.Sheet(Excel.Table(“YourTableName”).Worksheet).Range(“YourRangeA1:B” & Excel.Table(“YourTableName”).RowCount+1)” into Source.
or use the Activity “Find First/Last Data Row”, so you can get the exact range you need.
Kind Regards
firas
(Firas Abussaud)
January 4, 2023, 12:39pm
10
thanks again and excuse my reply as i am no developer!
this is what i got
no problem, I am no developer either .
Can you try:
and set “First row offset” to -1
then with
Excel.Sheet(Excel.Table(“Table1”).Worksheet).Range(“A” & firstrow & “:B” & lastrow)
where Table1 should be your Tablename and “A” and “:B” should be your columns
Kind Regards
1 Like
firas
(Firas Abussaud)
January 4, 2023, 1:03pm
12
Sorry but i got the same error!
firas
(Firas Abussaud)
January 4, 2023, 1:11pm
13
test project is attached
TestTables.zip (339.8 KB)
Test.zip (3.0 KB)
Edit:
does this work for you?
firas
(Firas Abussaud)
January 4, 2023, 3:29pm
16
I found the issue
it was the double quote; i just replaced all double quote with "
and it is now working like charm
thank you so much
1 Like
sorry, for not replying yesterday. And good
1 Like
firas
(Firas Abussaud)
January 5, 2023, 7:17am
18
it alright! you already helped me
thanks again
system
(system)
Closed
January 8, 2023, 7:18am
19
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.