보통 type이 맞지 않을 때 저와 같은 메세지가 뜨는데요…
Option Strict On이라는 것은… 해제할 수도 있는것인가요?
sheet_num+“sheet” <— 변수에 문자열을 붙여서 변수명을 생성하려고 하는데 저런 에러가 나더라구요. 그냥 해결할 수도 있는데, 자꾸 나오니까 의미가 궁금해져서요!
감사합니다.
보통 type이 맞지 않을 때 저와 같은 메세지가 뜨는데요…
Option Strict On이라는 것은… 해제할 수도 있는것인가요?
sheet_num+“sheet” <— 변수에 문자열을 붙여서 변수명을 생성하려고 하는데 저런 에러가 나더라구요. 그냥 해결할 수도 있는데, 자꾸 나오니까 의미가 궁금해져서요!
감사합니다.
Hi @Daun
Have you assign sheetname to string
then pass only the string name in sheetname
Thanks
Ashwin S
Hi @AshwinS2,
I want to create a dynamic table name such as table1, table2 in the Read Range activity, using the Index taken out from “For Each” activity. So I tried “table”+Index.ToString but it just throws a compile error. Please advise me!
I changed but I still don’t know how to name each table with a sequential name with numbers such as table1, table2, table3.
Here is the workflow! Thank you!
Main.xaml (9.4 KB)
hi @Daun
convert table_name as String instead of generic value
and use read range activity with excel application scope
Thanks
Ashwin S
Hi @Ashwin,
Assign Activity is okay now thanks
table_name = sheet_num.ToString+“table”
Read Range throws an error
Output Table = table_name
Read Range has been within Excel Application Scope like this
Excel Application Scope-> Do → For Each → Body → Read Range
What did you mean by putting read range within Excel Application Scope?
Could you please elaborate where to put “read range”?
Thank you!
Daniel
정확히 어떤것을 구현하고싶은지 의미파악이 되지않네요
본문에 적어주신 sheet_num + “sheet” 만 봤을때는 해당 오류가 나올수밖에 없습니다.
Sheet_num의 경우 Int 나 Double 형태로 변수선언을 해주셨을꺼고
“Sheet” 는 텍스트 즉 스트링 형태의 변수이기때문에 에러가 발생합니다.
다른 두 타입을 + 연산 을 시키는데 요즘 나오는 대부분의 언어는 암시적 형변환을 지원하여 Generic 변수처럼
어느정도 자기가 컨버트를 시켜서 연산을 진행하는데 위와같은경우
Sheet_num.tostirng 으로 String으로 형변환을 진행해주셔야 정상동작 할것같습니다.
일단 기본적으로 하고자 하시는게 정확히 파악되지는 않으나 소스 상으로 보았을때 다음과 같은 걸 유도 하신 것 같습니다.
결론적으로는 제 생각에 그거는 좀 힘들 것 같네요…
변수 유형도 GenericValue 보다는 명확하게 하는게 더 좋습니다. → String, Int …
table_name(String) = sheet_num(Int) + “table”(String)
sheet_num 이 Int 이므로 sheet_num.ToString 통해 String 형변환 진행
마지막 Read Range Activity 에서 OutArgument 가 DataTable 이나…
table_name 변수 즉, String 변수를 넣어주셨네요…
DataTable 변수를 넣어주셔야 하며, 임의의 DataTable변수 자동 생성을 생각하신 듯 하나
그렇게는 진행되지 않습니다.